package lzm.jsonobject;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;

public class JsonParse {

    /*public static void main(String[] args) {

        String responseStr = "{\"success\":false,\"status\":\"error\",\"message\":\"生成业务收款单异常：生成业务收款单提交共享流程失败：共享流程完成回调业务收款单异常业务收款单回写相关集成的业务提示：业务收款单流程结束回写应收：单位【经销商核算中心】，年度【2023】，期间【06】会计期间未打开，请到应收期间管理功能设置\",\"data\":null}";

//        responseStr = "{\n" +
//                "     \"success\": true,\n" +
//                "     \"status\": \"200\",\n" +
//                "     \"message\": \"success\",\n" +
//                "     \"data\": [\n" +
//                "          {\n" +
//                "               \"statuscode\": \"0\",\n" +
//                "               \"success\": true,\n" +
//                "               \"message\": \"\",\n" +
//                "               \"pkid\": \"LHZZ230816000030\",\n" +
//                "               \"gsid\": \"5e57df55-7fd9-4406-a6b2-78cc24162ab7\",\n" +
//                "               \"gscode\": \"YWSKD2023081600018\"\n" +
//                "          }\n" +
//                "     ]\n" +
//                "}";

        TypeReference<ComGenResult> type = new TypeReference<ComGenResult>(){};

        //TypeReference<GSCloudGenResponse<ComGenResult>>  typeReference = new TypeReference<GSCloudGenResponse<ComGenResult>>(GSCloudGenResponse.class, ComGenResult.class){};

        //GSCloudGenResponse<ComGenResult> response = JSON.parseObject(responseStr, typeReference);


        GSCloudGenResponse<GSCloudGenResponse<ComGenResult>> response = JSON.parseObject(responseStr,  org.apache.commons.lang3.reflect.TypeUtils.parameterize(GSCloudGenResponse.class, ComGenResult.class));

        System.out.println(response);

    }*/
}





